package org.apple.navigation;

import java.util.Random;

import org.apple.data.Position;

public class GpsNavigationDriver implements NavigationDriver {
	private Random random = new Random();
	
	private Position position;
	public GpsNavigationDriver () {
		this.position = new Position(0, 0);
	}
	
	public void nextPosition() {
		double lastX = position.getX();
		double lastY = position.getY();
		int moveX = random.nextInt() % 10;
		int moveY = random.nextInt() % 10;
		position.setX(lastX + moveX);
		position.setY(lastY + moveY);
	}

	public Position getPosition() {
		nextPosition();
		return position;
	}

}
